package com.example.tests;

public class ContactData implements Comparable<ContactData>{
	private String firstName;
	private String lastName;
	private String adressFirst;
	private String homeTel;
	private String mobileTel;
	private String workTel;
	private String emailFirst;
	private String emailSec;
	private String bday;
	private int bmonth;
	private String byear;
	public String contactGroup;
	private String adressSec;
	private String homeSec;

	public ContactData() {
		
	}

	@Override
	public String toString() {
		return "ContactData [lastName=" + lastName + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((lastName == null) ? 0 : lastName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		return true;
	}

	@Override
	public int compareTo(ContactData other) {
		
		return this.lastName.toLowerCase().compareTo(other.lastName.toLowerCase());
	}

	public ContactData withFirstName(String firstName) {
		this.firstName = firstName;	
		return this;
	}

	public ContactData withLastName(String lastName) {
		this.lastName = lastName;	
		return this;
	}

	public ContactData withAdressFirst(String adressFirst) {
		this.adressFirst = adressFirst;	
		return this;
	}

	public ContactData withHomeTel(String homeTel) {
		this.homeTel = homeTel;	
		return this;
	}

	public ContactData withMobileTel(String mobileTel) {
		this.mobileTel = mobileTel;	
		return this;
	}

	public ContactData withWorkTel(String workTel) {
		this.workTel = workTel;	
		return this;
	}

	public ContactData withEmailFirst(String emailFirst) {
		this.emailFirst = emailFirst;	
		return this;
	}

	public ContactData withEmailSec(String emailSec) {
		this.emailSec = emailSec;	
		return this;
	}

	public ContactData withBday(String bday) {
		this.bday = bday;	
		return this;
	}

	public ContactData withBmonth(int bmonth) {
		this.bmonth = bmonth;	
		return this;
	}

	public ContactData withByear(String byear) {
		this.byear = byear;	
		return this;
	}

	public ContactData withContactGroup(String contactGroup) {
		this.contactGroup = contactGroup;		
		return this;
	}
	
	public ContactData withAdressSec(String adressSec) {
		this.adressSec = adressSec;		
		return this;
	}

	public ContactData withHomeSec(String homeSec) {
		this.homeSec = homeSec;		
		return this;
	}

	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public String getAdressFirst() {
		return adressFirst;
	}

	public String getHomeTel() {
		return homeTel;
	}

	public String getMobileTel() {
		return mobileTel;
	}

	public String getWorkTel() {
		return workTel;
	}

	public String getEmailFirst() {
		return emailFirst;
	}

	public String getEmailSec() {
		return emailSec;
	}

	public String getBday() {
		return bday;
	}

	public int getBmonth() {
		return bmonth;
	}

	public String getByear() {
		return byear;
	}
	
	public String getContactGroup() {
		return contactGroup;
	}

	public String getAdressSec() {
		return adressSec;
	}

	public String getHomeSec() {
		return homeSec;
	}
	
	
}